< previous page page_326 next page >

Page 326
LISTING 14.4. THEinitializeSystemMETHOD OFCApplication.

9f8044bafea36a1f728739c0bb58ef4c.gif
 1:
 2: Public Function initializeSystem() As Byte
 3:     Dim returns
 4:     Set theAppTransactions = New AppTransactions
 5:     m_returns = theAppTransactions.setRichTextBox(frmLog!rtbDBLog,
  frmLog!rtbMemoryLog)
 6:     Set theSession = New CSession
 7:     theAppTransactions.activateLogging
 8:     theMDIController.showForm
 9:     theSession.showForm
10:     'theAppTransactions.deactivateLogging
11:     theAppTransactions.addTrans2MemLog _
12:         Allocated memory for theAppTransactions in
  CApplication.initializeSystem
13:     theAppTransactions.addTrans2MemLog _
14:         Allocated memory for theSession in CApplication.initializeSystem
15:     theAppTransactions.addTrans2MemLog _
16:         Allocated memory for ifcDBConnection in  & TypeName(Me) &
  .initializeSystem
17:     m_returns = theAppTransactions.addTrans2Text(Starting up the  &
  App.EXEName &  system)
18: 'Connect to the database
19:     'returns = ifcDBConnection.OpenConnection(, App.Path &
  \bank.mdb, False)
20: End Function

Listing 14.5 shows the clickLogin method of the controller class, CSession. The notable line of code is the logging of the user's ID and time stamp.
LISTING 14.5. THEclickLoginMETHOD OF THE CONTROLLER CLASS,CSession.

9f8044bafea36a1f728739c0bb58ef4c.gif
 1: Public Sub clickedLogin()
 2:     Dim returns
 3:     Set theEncryptor = New SHA1Encryption
 4:     theApplication.theUser.UserID = theForm.txtUserID
 5:     theApplication.theUser.UserPassword =
  theEncryptor.encrypt(theForm.txtPassword)
 6:
 7:     isLoggedIn = authenticate
 8:     If isLoggedIn Then
 9:         'Normally, you
10:         theAppTransactions.addTrans2MemLog _
11:             User  & theApplication.theUser.UserID &
   has logged in at  & Now$
12:
13:         theApplication.theMDIController.enableProcessMenu
continues

 
< previous page page_326 next page >

If you like this book, buy it!